package com.xyf.sys.service;

import com.alibaba.fastjson2.JSONObject;
import com.lop.open.api.sdk.LopException;
import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCheckPreCreateOrderV1.CommonCheckPreCreateOrderResponse;
import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetActualFeeInfoV1.CommonActualFeeResponse;
import com.xyf.sys.domain.OrderAddress;
import com.xyf.sys.domain.OrderProduct;
import com.xyf.sys.vo.DeliveryStock;
import com.xyf.sys.vo.LogisticCheck;
import com.xyf.sys.vo.OrderLogisticStep;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author R-H
 * @Date 2024/2/271730
 * @Description
 */
public interface ILogisticService {

    void logisticPackage(String mailNo, String productName, BigDecimal weight);

    /**
     * 面单余量查询
     *
     * @param appid     合作商appid（等同app-key）
     * @param partnerId 韵达大客户账号（韵达业务方提供）
     * @param secret    韵达大客户秘钥（韵达业务方提供）
     * @param type      common 普通 df 到付 cod 代收货款
     */
    String searchCount(String appid, String partnerId, String secret, String type);

    /**
     * @param senderAddress
     * @param receiverAddress
     * @param product
     * @return
     */
    String createBmOrder(OrderAddress senderAddress, OrderAddress receiverAddress, BigDecimal weight, String name, String remark);


    String createEMSOrder(OrderAddress senderAddress, OrderAddress receiverAddress, String contentsAttribute, String cargoName);

    String createJTOrder(OrderAddress senderAddress, OrderAddress receiverAddress, String txlogisticId, String goodsType, String weight);

    /**
     * 停发查询接口
     *
     * @param senderAddress
     * @param receiverAddress
     */
    JSONObject queryRoute(String senderAddress, String receiverAddress);

    /**
     * 散件盲区检验
     *
     * @param logisticCheckRequestVo
     * @return
     */
    Object check(LogisticCheck logisticCheckRequestVo) throws LopException;

    /**
     * 订单创建接口
     *
     * @param orderId
     * @return
     */
    List<OrderProduct> createOrder(String orderId);

    List<OrderProduct> createOrder(String orderId, String deliveryId, OrderAddress senderAddress, OrderAddress receiverAddress, List<OrderProduct> orderProducts);


    /**
     * 查询物流
     *
     * @param orderId
     * @param deliveryId
     * @param waybillId
     * @return
     */
    List<OrderLogisticStep> queryLogistic(String orderId, String deliveryId, String waybillId, String appid, String secret, String userId);

    /**
     * 取消订单
     *
     * @param orderId
     * @param deliveryId
     * @param waybillId
     * @return
     */
    Boolean cancelOrder(String orderId, String deliveryId, String waybillId);

    Boolean cancelSfOrder(String orderId, String deliveryId, String waybillId, String appid, String secret, String userId);

    DeliveryStock queryStock(String deliveryId, String userId);

    String logisticSubscribe(String deliveryId, OrderAddress sender, OrderAddress receiver, String orderSerialNo, String waybillId);

    OrderProduct subscribeOrder(String orderId, String userId);

    Object getEMSWaybill(String waybillNo);

    JSONObject print(String orderId, Long printerId, String userId, Long deptId);

    JSONObject sfExpressQueryDelivertm(String businessType, BigDecimal weight, String consignedTime, String searchPrice, OrderAddress receiverAddress, OrderAddress senderAddress);

    CommonActualFeeResponse queryJDActualFee(String waybillId);

    CommonCheckPreCreateOrderResponse jdPreCheck(String deliveryId, OrderAddress senderAddress, OrderAddress receiverAddress, String name, Integer quantity, BigDecimal volume, BigDecimal weight, String expressType);

    String realName(String delivery, String name, String valididcardCode, String phone, String address);
}
